#include "stdafx.h"
#include <rt/Exceptions/COMException.h>
#include "Fakes/FakeD3D10Device.h"
#include "Fakes/FakeD3D10Predicate.h"

DESCRIPTION_10_TEST_SUITE_CTOR(PredicateDescription, (D3D10_QUERY_OCCLUSION_PREDICATE))

BOOST_FIXTURE_TEST_CASE(Default, TestPredicateDescription)
{
	BOOST_REQUIRE_EQUAL(D3D10_QUERY_OCCLUSION_PREDICATE, m_desc.Query);
	BOOST_REQUIRE_EQUAL(0, m_desc.MiscFlags);
}

DESCRIPTION_10_TEST_CASE(UINT, MiscFlags, D3D10_RESOURCE_MISC_SHARED, PredicateDescription)

BOOST_FIXTURE_TEST_CASE(Create, TestPredicateDescription)
{
	FakeD3D10Device device;
	FakeD3D10Predicate predicate;
	device.CreatePredicateFakeResult = &predicate;
	device.CreatePredicateFakeHResult = S_OK;
	ID3D10Predicate *result = m_desc.Create(&device);
	BOOST_REQUIRE(device.CreatePredicateCalled);
	BOOST_REQUIRE_EQUAL(&m_desc, device.CreatePredicateLastDesc);
	BOOST_REQUIRE_EQUAL(&predicate, result);
}

BOOST_AUTO_TEST_SUITE_END()
